package test3;

public class GFtest {
    public static void main(String[] args) {
        GF[]arr=new GF[4];
        GF G1=new GF("刘亦菲",25,"女","插花");
        GF G2=new GF("刘浩存",18,"女","跑步");
        GF G3=new GF("朱珠",30,"女","画画");
        GF G4=new GF("范冰冰",32,"女","跳舞");

        arr [0] =G1;
        arr [1] =G2;
        arr [2] =G3;
        arr [3] =G4;

        int sum=0;
        for (int i = 0; i < arr.length; i++) {
            GF gf = arr[i];
            sum=sum+gf.getAge();
        }
        int avg=sum/arr.length;
        int count =0;
        for (int i = 0; i < arr.length; i++) {
            GF gf = arr[i];
            if (arr[i].getAge()<avg){
                count++;
                System.out.println(gf.getName()+","+gf.getAge()+","+gf.getGender()+","+gf.getHobby());
            }
        }
        System.out.println(count);
        }
    }

